/*
 * @Descripttion:
 * @version:
 * @Author: kl2018
 * @Date: 2019-03-07 20:06:20
 * @LastEditors: kl2018
 * @LastEditTime: 2020-09-01 10:14:18
 */
import React, { Component } from 'react';
import { WeaDialog, WeaLocaleProvider } from 'ecCom';
import { Row, Col, Card } from 'antd';
import { inject, observer } from 'mobx-react';

const getLabel = WeaLocaleProvider.getLabel;

@inject('receiveDoc')
@observer
class CreatFlowDialogComponnet extends Component {
  render () {
    const { receiveDoc } = this.props;
    const { setMobxState } = receiveDoc;
    return (
      <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@t342u3`}
        title={getLabel('388475', '请选择需要创建的流程')}
        icon={'icon-coms-workflow'}
        iconBgcolor={'#0079de'}
        onCancel={() => setMobxState({ showCreatFlow: false })}
        visible={receiveDoc.showCreatFlow}
        buttons={[]}
        style={{ width: 1000, height: 600 }}
      >
        <Row ecId={`${this && this.props && this.props.ecId || ''}_Row@rw14wn`}>
          {
            receiveDoc.flowListData.map((item, index1) => (
              <Col ecId={`${this && this.props && this.props.ecId || ''}_Col@co47up@${index1}`} span="12" className="creatFlowCol" key={index1}>
                <Card ecId={`${this && this.props && this.props.ecId || ''}_Card@its5r6@${index1}`} className="creatCard" style={{ borderTop: `3px solid ${item.color}`, background: 'rgb(244,244,244)' }}>
                  <div className="creatFlowColTop" >
                    <i className={item.img} style={{ color: `${item.color}` }} />
                    <span className="typeName">{item.typeName}({item.wfCount})</span>
                  </div>
                  {item.wfbeans.map((list, index2) => (
                    <a key={index2} className="flowWorkName" onClick={() => receiveDoc.openCreatFlowWindow(list.id, list.name)}>{list.name}</a>
                  ))}
                </Card>
              </Col>
            ))
          }
        </Row>

      </WeaDialog>
    );
  }
}

export default CreatFlowDialogComponnet;

